const express = require("express");
const router = express.Router();
const UserService = require("../service/UserService");
const Result = require("../utils/Result");

router.get("/:id",  async (req, res) => {
    const result = await UserService.getUserById(req.params.id);
    console.log("userController----", result);
    res.json(new Result(result));
})

router.get("/",  async (req, res) => {
    const result = await UserService.listUsers();
    console.log("userController----", result);
    res.json(new Result(result));
})

module.exports = router;